Closed
Bug 1424368
Opened 7 years ago
Closed 7 years ago
comparison of constant -1 with expression of type 'const (anonymous namespace)::WasmToken::Kind' is always true [-Werror,-Wtautological-constant-out-of-range-compare]
Categories
(Core :: JavaScript Engine: JIT, defect)
Core
JavaScript Engine: JIT
Tracking
()
RESOLVED
FIXED
mozilla59
Tracking | Status | |
---|---|---|
firefox59 | --- | fixed |
People
(Reporter: Sylvestre, Assigned: bbouvier)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
With clang trunk:
In file included from /data/jenkins/workspace/firefox-clang-last/obj-x86_64-pc-linux-gnu/js/src/Unified_cpp_js_src42.cpp:47:
/data/jenkins/workspace/firefox-clang-last/js/src/wasm/WasmTextToBinary.cpp:234:26: error: comparison of constant -1 with expression of type 'const (anonymous namespace)::WasmToken::Kind' is always true [-Werror,-Wtautological-constant-out-of-range-compare]
MOZ_ASSERT(kind_ != Kind(-1));
~~~~~ ^ ~~~~~~~~
/data/jenkins/workspace/firefox-clang-last/obj-x86_64-pc-linux-gnu/dist/include/mozilla/Assertions.h:457:46: note: expanded from macro 'MOZ_ASSERT'
# define MOZ_ASSERT(...) MOZ_RELEASE_ASSERT(__VA_ARGS__)
^~~~~~~~~~~
/data/jenkins/workspace/firefox-clang-last/obj-x86_64-pc-linux-gnu/dist/include/mozilla/Assertions.h:454:6: note: expanded from macro 'MOZ_RELEASE_ASSERT'
(__VA_ARGS__))
^~~~~~~~~~~
/data/jenkins/workspace/firefox-clang-last/obj-x86_64-pc-linux-gnu/dist/include/mozilla/Assertions.h:450:41: note: expanded from macro 'MOZ_RELEASE_ASSERT_GLUE'
#define MOZ_RELEASE_ASSERT_GLUE(a, b) a b
^
/data/jenkins/workspace/firefox-clang-last/obj-x86_64-pc-linux-gnu/dist/include/mozilla/Assertions.h:433:51: note: expanded from macro 'MOZ_ASSERT_HELPER1'
if (MOZ_UNLIKELY(!MOZ_CHECK_ASSERT_ASSIGNMENT(expr))) { \
^~~~
/data/jenkins/workspace/firefox-clang-last/obj-x86_64-pc-linux-gnu/dist/include/mozilla/StaticAnalysisFunctions.h:56:47: note: expanded from macro 'MOZ_CHECK_ASSERT_ASSIGNMENT'
#define MOZ_CHECK_ASSERT_ASSIGNMENT(expr) (!!(expr))
^~~~
/data/jenkins/workspace/firefox-clang-last/obj-x86_64-pc-linux-gnu/dist/include/mozilla/Likely.h:17:48: note: expanded from macro 'MOZ_UNLIKELY'
# define MOZ_UNLIKELY(x) (__builtin_expect(!!(x), 0))
Comment hidden (mozreview-request) |
Assignee | ||
Comment 3•7 years ago
|
||
The attached patch removes the -1 enum value hack and uses a real Invalid enum value instead, which should be enough for static analysis.
Flags: needinfo?(bbouvier)
Assignee | ||
Updated•7 years ago
|
Assignee: nobody → bbouvier
Status: NEW → ASSIGNED
Reporter | ||
Comment 4•7 years ago
|
||
To be clear, this is a warning with gcc 8
![]() |
||
Comment 5•7 years ago
|
||
mozreview-review |
Comment on attachment 8936646 [details]
Bug 1424368: Use an enum value for invalid WasmToken::Kind;
https://reviewboard.mozilla.org/r/207388/#review213312
Thanks!
Attachment #8936646 -
Flags: review?(luke) → review+
Pushed by bbouvier@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/a5c733e0b6d1
Use an enum value for invalid WasmToken::Kind; r=luke
Comment 7•7 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla59
Reporter | ||
Updated•7 years ago
|
Blocks: build-clang-trunk
Reporter | ||
Updated•7 years ago
|
No longer blocks: clang-based-analysis
You need to log in
before you can comment on or make changes to this bug.
Description
•